/*
** Capcom Q-Sound Sound Format driver for SMSE2K
** Based on qsound.c
** by unknownfile, 2009
**
*/

#include "smse2kincludes.h"
#include "driver.h"
#include "qsfdriver.h"

/*************************************************************
						MMU Handlers
*************************************************************/
UINT8 QSFDriver::readmem(UINT16 addr) {
	if (addr < 0x8000)			// Music code
		return this->rom[addr];
	else if (addr < 0xc000)		// Music data, bank-switched
		return this->rom[0x80000 + (this->rombank * 0x4000) + (addr ^ 0x8000) ];
	else if (addr < 0xd000)		// Shared RAM
		return this->sharedram1[addr ^ 0xc000];
	else if (addr == 0xd007)	// Q-Sound read registers
		return 0;
	else if (addr >= 0xf000)    // Shared RAM part deux
		return this->sharedram2[addr ^ 0xf000];
	else
		return 0;
}

/****************************************************************
				     Generic Driver Handlers
****************************************************************/

int QSFDriver::init(int subsong) {

	// Add hardware

	return 1;
}